package cc.atliberty.oa.service.impl;

import cc.atliberty.oa.mapper.DeptMapper;
import cc.atliberty.oa.pojo.Dept;
import cc.atliberty.oa.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

@Transactional
@Service("deptService")
public class DeptServiceImpl implements DeptService {
    
    @Autowired
    private DeptMapper deptMapper;
    @Override
    public List<Dept> deptDetail() {
        return deptMapper.selectAll();
    }

    @Override
    public int deleteDept(String deptno) {
        return deptMapper.deleteBydeptno(deptno);
    }

    @Override
    public int saveDept(Dept dept) {
        return deptMapper.insertDept(dept);
    }

    @Override
    public Dept deptDetail(String deptno) {
        return deptMapper.selectDeptBydeptno(deptno);
    }

    @Override
    public int modifyDept(Dept dept) {
        return deptMapper.updateDept(dept);
    }
}
